<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>凉山州中考志愿填报</title>
    <link rel="stylesheet" href="css/newStyle.css">
</head>
<body>
    <div class="mainBox">
        <div class="mainBox_inner">
            <h1>凉山州中考信息管理系统(州教育科学和体育局)</h1>
            <div class="formOutBox">
                <h2>登录入口</h2>
                
                <form action="/state/check" th:action="@{/state/check}"
					th:object="${zkw}" method="post" id=loginform class="formbox">
                    <div class="form_item">
                        <label for="bmh">用户名：</label>
                        <input type="text" name="userid" id="bmh" maxlength="8">
                    </div>
                    <div class="form_item">
                        <label for="password">密&emsp;码：</label>
                        <input type="password" name="password" id="password" maxlength="8">
                    </div>
                    <div class="form_item">
                        <label for="yzm">验证码：</label>
                        <input type="text" name="yzm" id="yzm">
                        <div id="v_container" style="width: 140px; height: 32px;"></div>
                    </div>
                    <div class="form_item btnbox">
                        <button type="button" id="loginBtn" class="btnclass">登录</button>
                    </div>
                    	<div class="form_item ">
						<label class="bmhpassworderror" th:text="${msg}" ></label>
					</div>
                </form>
                <div class="tipsBox">
                    <ul>
                       
                    </ul>
                </div>
            </div>
        </div>
    </div>
</body>
<script src="js/jquery-1.12.3.js"></script>
<script src="js/gVerify.js"></script>
<script src="js/commen.js"></script>
<script src="js/checkPassword.js"></script>
<script>
/*
主要有一下几个方面进行验证：
	 1.报名号和密码最大长度为12
	 2.密码必须包含数字和字符
	 3.密码长度最低为8
	 4.验证码不正确需要重新输入
* */
var verifyCode = new GVerify("v_container");
$("#loginBtn").on('click',function(){
   var res = verifyCode.validate($('#yzm').val());
   var password1 = $("#password").val();
   if(password1=="" ||$("#bmh").val()=="" ) {
		alert("不允许为空！");
	}else {
		 //验证密码强度
		   var check_str_pass = check_str(password1);
		   if(check_str_pass == true){
		   	if(res){
	            //验证成功后执行
	            $('#loginform').submit();
		       }else{
		           alert("验证码错误");
		       }
		   }else {
		   		alert(check_str_pass);
		   }
	}
  
});
$("#bmh").click(function(){

	$(".bmhpassworderror").html("")
})
</script>
</html>